package freezzz.server.EventDriver;

import freezzz.client.EventWidget.EventType;
import freezzz.client.EventWidget.TimelineEvent;

import java.util.ArrayList;
import java.util.Date;
import java.util.Random;

/**
 * Created by Ivan Litsvinenka e Emanuele Ricci
 * Date: 27-ago-2009
 * Time: 23.16.07
 */
public class DriverDummyEvents extends EventsDriver {
    private static final EventType[] eventTypes = { new EventType ( "Date", "res/icons/heart.png" ), new EventType ( "Poker", "res/icons/playing_card.png" ), new EventType ( "Work", "res/icons/briefcase.png" ), new EventType ( "Doctor", "res/icons/bandaid.png" ), new EventType ( "Tourney", "res/icons/trophy.png" ) };

    public ArrayList<TimelineEvent> getEventsForDate ( Date date ) {
        Random rnd = new Random ();
        int numEvents = rnd.nextInt ( 5 );
        ArrayList<TimelineEvent> result = new ArrayList<TimelineEvent> ();
        for ( int i = 0; i < numEvents; i++ ) {
            result.add ( new TimelineEvent ( date, "Title3", " OMG rescrive la libreria per la integrazione con Friendfeed/Twitter/Facebook in 4 ore in modo che funzione sul Google App Engine non ha prezzo! Che fotta! Pm se a qualcuno serve.", eventTypes[ rnd.nextInt ( eventTypes.length ) ] ) );
        }
        return result;
    }
}
